package com.example.uitmanagement;

import java.util.ArrayList;
import java.util.HashMap;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

public class Activity_list_registry extends Activity {

	private JsonParser JSON=new JsonParser();
	ListView list;
	ArrayList<HashMap<String, String>> ArrayMap = new ArrayList<HashMap<String, String>>(); 
    ArrayAdapterRegistry adapter;
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_list_registry);             
        ArrayMap = JSON.getMap();
        list=(ListView)findViewById(R.id.list_registry);
        adapter =new ArrayAdapterRegistry(this, ArrayMap);
        list.setAdapter(adapter);
        // Click event for single list row
        list.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> parent, View view,
					int position, long id) {							

			}
		});		
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        /*getMenuInflater().inflate(R.menu.activity_list_registry, menu);
        return true;*/
    	 MenuInflater inflater = getMenuInflater();
    	    inflater.inflate(R.menu.activity_list_registry, menu);
    	    return true;
    }
}
